import { renderContext } from '../../src/runtime';
import { compileModelData, compileTemplateData } from '../../src/compiler';
import * as flexBox from '../../src/container/flex-box';
import * as gridBox from '../../src/container/grid-box';

import Greeting from '../runtime/Greeting.vue';

const render = renderContext({
  componentMap: {
    FlexBox: flexBox.View,
    GridLayout: gridBox.View,
    Greeting,
  },
});

import('./sample.json').then((json) => {
  const model = compileModelData(json.model);
  const template = compileTemplateData(json.template);
  render('#compiler', template, model);
});
